# Contributor: Michael Mason <ms13sp@gmail.com>
# Maintainer: Michael Mason <ms13sp@gmail.com>
pkgname=tinyproxy
pkgver=1.11.2
pkgrel=0
pkgdesc="Lightweight HTTP proxy"
url="https://tinyproxy.github.io/"
arch="all"
license="GPL-2.0-or-later"
install="tinyproxy.pre-install"
subpackages="$pkgname-doc $pkgname-openrc"
source="https://github.com/tinyproxy/tinyproxy/releases/download/$pkgver/tinyproxy-$pkgver.tar.gz
	tinyproxy.initd
	"
pkgusers="tinyproxy"
pkggroups="tinyproxy"
options="!check"

# secfixes:
#   1.11.2-r0:
#     - CVE-2023-49606
#   1.11.1-r2:
#     - CVE-2022-40468

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--localstatedir=/var \
		--sysconfdir=/etc \
		--disable-dependency-tracking \
		--enable-reverse
	make
}

package() {
	make DESTDIR="$pkgdir" install
	install -d -D -o tinyproxy -g tinyproxy "$pkgdir"/var/log/tinyproxy
	install -Dm755 "$srcdir"/tinyproxy.initd "$pkgdir"/etc/init.d/tinyproxy
}

sha512sums="
d7cdc3aa273881ca1bd3027ff83d1fa3d3f40424a3f665ea906a3de059df2795455b65aeebde0f75ae5cacf9bba57219bc0c468808a9a75278e93f8d7913bac5  tinyproxy-1.11.2.tar.gz
0b4cf9c0904c766d227fc50bcdba4a602f9352009ab9c5b4b73e260414e4963f8010d83016605bae5a681f5af4dec12a76a57b2a84ebbf9ffe3709e78a4e29e8  tinyproxy.initd
"
